#!/usr/bin/python
# Filename: 22.py

import zlib, bz2
import os, sys
path_sep = os.sep
pwd = sys.path[0]+path_sep
fp = open(pwd+'resources'+path_sep+'22'+path_sep+'package.pack', 'rb')
info = fp.read()
logs = []
while True:
	if(info[0:2] == 'BZ'):
		info = bz2.decompress(info)
		logs.append('b')
	elif(info[0:2] == 'x\x9c'):
		info = zlib.decompress(info)
		logs.append(' ')
	else:
		info = info[::-1]
		logs.append('\n')
	if(len(info) == 17): 
		print info[::-1]
		break
	# print "len[info] = ", len(info)
	open(pwd+"output"+path_sep+"22.out", "w").write(''.join(logs))